/* 
 *  <copyright file="ExampleGame.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */

/*
 * */

using System;

using Microsoft.Xna.Framework;


namespace SEGameExample
{
    class ExampleGame : SobrietyEngine.Games.SobrietyGame
    {

        Boolean Startup = true;

        public ExampleGame()
            : base()
        {
            //add our content location
            AssetGameService.CreateContentManager("SEGameExample", "SEGameExampleContent");

            //add our compnents to the factory
            SEGameExample.Components.RegisterComponentsWithFactory.Register();
            
            //add gameServices services
        }

        /// <summary>
        /// Allows the gameServices to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();

        }



        /// <summary>
        /// LoadContent will be called once per gameServices and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            base.LoadContent();
            // TODO: use this.Content to load your gameServices content here
        }

        /// <summary>
        /// UnloadContent will be called once per gameServices and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
            base.UnloadContent();
        }

        /// <summary>
        /// Allows the gameServices to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (Startup)
            {
                ScreenGameService.AddScreen(new Screens.MainMenu());
                ScreenGameService.AddScreen(new SobrietyEngine.Screens.DebugConsole());
                Startup = false;
            }
        }

        /// <summary>
        /// This is called when the gameServices should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }
    }
}